﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using CNVP.Framework;
using CNVP.Framework.Helper;
using CNVP.Config;
using CNVP.JShop.UI;
using CNVP.Framework.Utils;
using System.Reflection;

namespace CNVP.JShop.Web.Admin.CommonWindows
{
    public partial class MenuAjax : AdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!BLL.BLLCheckAdmin.LoginOk(Page, 75)) return;//判断页面权限
            Response.Buffer = true;
            Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
            Response.AddHeader("pragma", "no-cache");
            Response.AddHeader("cache-control", "");
            Response.CacheControl = "no-cache";
            Response.ContentType = "application/json";
            string Action = "ColumnSet";
            string ID = Request.Params["ID"];
            switch (Action)
            {
                case "ColumnSet":
                    ColumnOperate("TemplateSet", "ColumnSet", "MenuSet.aspx", true);
                    break;
            }
        }
        #region "栏目操作"
        /// <summary>
        /// 栏目导航
        /// </summary>
        private void ColumnOperate(string Permissions, string Operate, string Url, bool ShowAll)
        {
            CNVP.JShop.BLL.CNVP_Menu bll = new CNVP.JShop.BLL.CNVP_Menu();
            string ParentID = Request.Params["ParentID"];
            if (string.IsNullOrEmpty(ParentID) | (!Public.IsNumber(ParentID)))
            {
                ParentID = "0";
            }
            if (ParentID == "0")
            {
                Response.Write(new BLL.BLLMenu().GetClass(int.Parse(ParentID), Url));
            }
            else
            {
                Response.Write(new BLL.BLLMenu().GetClass(int.Parse(ParentID), Url));
            }
            Response.End();
        }
        #endregion
    }
}